/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Container with responsive height - iframe vs full screen */
.container {
    width: 100%;
    height: 450px; /* Default iframe height */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Full screen detection */
@media screen and (min-height: 500px) {
    .container {
        height: 90vh;
    }
}

/* Tooltip for header information */
.tooltip {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    text-align: center;
}

.container:hover .tooltip {
    opacity: 1;
}

/* Progress indicator */
.progress-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 16.67%; /* 1/6 steps */
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Main kiosk layout */
.kiosk-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 12px;
    padding: 12px;
    min-height: 0;
}

/* Wallet section */
.wallet-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.wallet-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
    text-align: center;
}

.wallet-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cash-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.note {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    cursor: grab;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.note:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.note:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card {
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    cursor: grab;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nets-card {
    background: linear-gradient(135deg, #FF6B6B, #ee5a52);
    color: white;
}

.credit-card {
    background: linear-gradient(135deg, #4ECDC4, #44a08d);
    color: white;
}

.ezlink-card {
    background: linear-gradient(135deg, #45B7D1, #3498db);
    color: white;
}

.balance {
    font-size: 10px;
    opacity: 0.9;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Kiosk screen */
.kiosk-screen {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.screen-logo {
    color: #00bcd4;
    font-weight: bold;
    font-size: 16px;
}

.help-btn {
    background: #666;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.help-btn:hover {
    background: #888;
}

.screen-content {
    flex: 1;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 0;
}

.hidden {
    display: none !important;
}

/* Welcome screen */
.welcome-message h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 18px;
}

.welcome-message p {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

.touch-indicator {
    font-size: 24px;
    animation: pulse 2s infinite;
    cursor: pointer;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Payment methods */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.payment-btn {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.payment-btn:hover {
    border-color: #00bcd4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.payment-icon {
    font-size: 20px;
}

.payment-btn span {
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

/* Amount selection */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 200px;
    margin-bottom: 12px;
}

.amount-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.amount-info {
    font-size: 12px;
    color: #666;
}

/* Payment execution */
.payment-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cash-slot, .card-slot, .card-reader {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 250px;
    text-align: center;
    transition: all 0.3s ease;
}

.cash-slot.drag-over, .card-slot.drag-over, .card-reader.drag-over {
    border-color: #4CAF50;
    background: #e8f5e8;
}

.slot-indicator, .reader-indicator {
    font-size: 18px;
    margin-top: 8px;
    opacity: 0.7;
}

/* PIN pad */
.pin-pad {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    width: 100%;
    max-width: 250px;
}

.pin-display {
    margin-bottom: 12px;
}

.pin-display input {
    width: 100%;
    padding: 8px;
    font-size: 16px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.key-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.key-btn:hover {
    background: #f0f0f0;
}

.key-btn:active {
    transform: scale(0.95);
}

.key-btn.confirm {
    background: #4CAF50;
    color: white;
}

.key-btn.clear {
    background: #f44336;
    color: white;
}

/* Transaction completion */
.success-message h2 {
    color: #4CAF50;
    margin-bottom: 16px;
    font-size: 18px;
}

.transaction-details {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 12px;
}

.transaction-details p {
    margin: 4px 0;
}

.receipt-btn, .restart-btn, .retry-btn, .cancel-btn {
    background: #00bcd4;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    margin: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.receipt-btn:hover, .restart-btn:hover, .retry-btn:hover {
    background: #0097a7;
}

.cancel-btn {
    background: #f44336;
}

.cancel-btn:hover {
    background: #d32f2f;
}

/* Error screen */
.error-message h2 {
    color: #f44336;
    margin-bottom: 12px;
    font-size: 18px;
}

.error-message p {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Hardware section */
.kiosk-hardware {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hardware-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cash-acceptor, .card-reader-hw, .receipt-printer {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.acceptor-label, .reader-label, .printer-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
    font-weight: bold;
}

.acceptor-slot, .reader-slot, .printer-slot {
    background: #333;
    height: 20px;
    border-radius: 2px;
    margin: 4px auto;
    width: 80%;
}

/* Help modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.help-content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.help-content li {
    margin: 8px 0;
    font-size: 14px;
}

.help-content p {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .kiosk-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 8px;
        padding: 8px;
    }
    
    .wallet-section {
        order: 3;
        max-height: 120px;
    }
    
    .kiosk-screen {
        order: 1;
    }
    
    .kiosk-hardware {
        order: 2;
        max-height: 80px;
        flex-direction: row;
    }
    
    .cash-notes {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cards {
        flex-direction: row;
        gap: 4px;
    }
    
    .card {
        flex: 1;
        font-size: 10px;
        padding: 6px;
    }
}

/* Touch-friendly sizing */
@media (pointer: coarse) {
    .payment-btn, .amount-btn, .key-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .note, .card {
        min-height: 40px;
    }
}

/* Animation for drag and drop feedback */
.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.payment-status {
    margin-top: 12px;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.payment-status.success {
    background: #e8f5e8;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.payment-status.error {
    background: #ffebee;
    color: #f44336;
    border: 1px solid #f44336;
}

/* Accessibility improvements */
button:focus, .note:focus, .card:focus {
    outline: 2px solid #00bcd4;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .screen-content {
        background: white;
        border: 2px solid #000;
    }
    
    .payment-btn {
        border-color: #000;
    }
}